package com.wes.wtools;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {
    private Context mContext;
    private RootHandler rootHandler;

    private boolean broot = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mContext = this;
        setContentView(R.layout.activity_main);
        Button btnADB = findViewById(R.id.bt_wifiADB);
        rootHandler = new RootHandler(mContext);

        Toast.makeText(mContext, "root is"+rootHandler.isRootAvailable(), Toast.LENGTH_LONG).show();
        btnADB.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                broot = rootHandler.executeAdb();
                Toast.makeText(mContext, "wifi adb settings:" + broot, Toast.LENGTH_LONG).show();
            }
        });
    }
}